import os

import logger

log = logger.get_logger()

def exist_create_dir(path):
    """
    判断目录是否存在并创建目录
    :param path: 路径
    :return:
    """
    log.debug("[exist_create_dir:params]:%s" % path)
    dirName = os.path.dirname(path)
    if not os.path.exists(dirName):
        log.info("this dir not exists, need to be created")
        os.makedirs(dirName)
        log.info("the path create success")
    else:
        log.info("this path has existed")
